Thin-film devices such as semiconductor wafers or for use in liquid crystal displays and magnetic heads for hard disk drives are fabricated through a large number of processing steps. In the fabrication of such a thin-film device, an appearance inspection is performed at the end of each of process flows for the purpose of yield improvement and consistent production. In the appearance inspection, a pattern defect or a defect such as foreign substance is detected based on a reference image and an inspection image obtained by illuminating a region with lamp light, laser, electron beam or the like, the region corresponded by two patterns which are to be fundamentally formed in the same configuration. More specifically, the reference image and inspection image are registered with each other and a difference therebetween is calculated. The difference is compared with a previously defined threshold. A portion exhibiting a greater difference than the threshold is detected as a defect or foreign substance. Patent Literature 1 (Patent Publication No. 3566589) discloses the following defect inspection method as a threshold calculation method. The defect inspection method includes: an illumination step wherein longitudinally nearly parallel slit beams are applied onto a substrate as an inspection object which is formed with a circuit pattern and carried on a stage, the slit beams applied substantially at right angles to a scanning direction of the stage having a predetermined inclination relative to the normal direction of the substrate, having a plane inclined at a predetermined angle to a main straight line group of the circuit pattern and carrying thereon the substrate as the inspection object in a longitudinal direction; a detection step wherein reflective scattered light from a defect such as a foreign substance present on the substrate as the inspection object illuminated by the illumination step is received by an image sensor and converted into a signal for detection; and a defect judgment step wherein a signal indicative of the defect such as the foreign substance is extracted on the basis of the signal detected by the detection step.
In such an inspection, the detection of microscopic defects requires defect judgment to be made with a threshold set to a low value. However, the judgment with the low threshold entails the detection of a large number of false defects attributable to sampling errors, microscopic pattern differences such as roughness and grains, luminance variations due to film thickness variations or the like. If the threshold is set to such a high value as to sufficiently lower the rate of false defects to the entire wafer, the sensitivity is traded off, disabling the detection of microscopic defects. A method for enhancing the sensitivity is disclosed in Patent Literature 2 (JP-A No. 2004-79593). The method includes the steps of: performing a preliminary inspection for obtaining locations of the false defects; dividing an inspection region into a plurality of areas according to the densities of false defects; and applying a different threshold to each of the divided areas and determining the presence of the foreign substance on the surface of the inspection object on the basis of intensity of detected reflection light or scattered light. Further, Patent Literature 3 (JP-A NO. 2009-2743) discloses an appearance inspection method for defect detection by the use of detection signal obtained by applying light or electron beam onto a substrate to be inspected. This appearance inspection method includes: a step of calculating a feature quantity on the basis of an image of the detected defect; a step of calculating a coordinate feature quantity on the basis of positional information on the detected defect; and a step of outputting real defect information by performing false defect judgment according to a decision tree defined by a threshold processing on one of the image feature quantity and the image feature quantity. Furthermore, Patent Literature 4 (Patent Publication No. 4095860) discloses an inspection method for sample defect. The method includes: a step of capturing an appearance image of an observation object; a step of detecting an area of the appearance image that is different from an expected appearance; a step of calculating a feature quantity of the detected area; a step of superimposing on top of each other images containing the areas different from the expected appearance that are detected by sequentially performing an operation flow from the image capturing step to the calculation step on a plurality of observation objects of the sample which should fundamentally have the same appearance, and grouping the areas containing defect candidates which are produced by nearby grains or film thickness interference and are in proximity but not necessarily the same; a step of summing up the feature quantities of the detected areas in each of the obtained groups; and a step of deciding an attribute of the detected area by comparing the feature quantity of the detected area belonging to the group with a distribution of the feature quantity sums. Furthermore, Patent Literature 5 (JP-A No. 2006-98155) discloses an inspection method which includes the steps of: inspecting a sample; displaying on a screen an image of defects detected in the inspection; specifying a target defect selected from the displayed defects; extracting, from the image of the detected defects, a defect having a feature quantity similar to that of the specified target defect; displaying an image of the extracted defect on the screen; instructing a defect present in the displayed defect image and similar to the specified target defect; defining a defect inspection condition based on the instruction-input information; and inspecting the sample based on the defined inspection condition.